import request from '@/utils/WMSRequest'

// 查询产品列表
export function ProductList(query) {
  return request({
    url: '/wms/product/list',
    method: 'get',
    params: query
  })
}

// 查询产品原料配方列表
export function FormulaList(query) {
  return request({
    url: '/wms/product/formula',
    method: 'get',
    params: query
  })
}

// 删除产品
export function delProduct(id) {
  return request({
    url: '/wms/product/' + id + '/',
    method: 'delete'
  })
}

// 查询产品详细
export function GetProductDetail(id) {
  return request({
    url: '/wms/product/' + id,
    method: 'get'
  })
}

// 查询产品详细
export function UpdateProduct(id, data) {
  return request({
    url: '/wms/product/' + id + '/',
    method: 'patch',
    data: data
  })
}

// 查询产品详细
export function CreateProduct(data) {
  return request({
    url: '/wms/product/',
    method: 'post',
    data: data
  })
}
